package cn.bdqn.t354.service.impl;

import cn.bdqn.t354.mapper.LinkmanMapper;
import cn.bdqn.t354.pojo.Linkman;
import cn.bdqn.t354.service.LinkmanService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LinkmanServiceImpl implements LinkmanService {
    @Resource
    private LinkmanMapper linkmanMapper;

    @Override
    public List<Linkman> getLinkmanByCustNo(String custNo) {
        QueryWrapper<Linkman> qw=new QueryWrapper<>();
        qw.eq("lkm_cust_no",custNo);
        return linkmanMapper.selectList(qw);
    }

    @Override
    public void addLinkman(Linkman linkman) {
        linkmanMapper.insert(linkman);
    }

    @Override
    public Linkman getLinkman(Long id) {
        return linkmanMapper.selectById(id);
    }

    @Override
    public void updateLinkman(Linkman linkman) {
        linkmanMapper.updateById(linkman);
    }

    @Override
    public void deleteLinkman(Long id) {
       linkmanMapper.deleteById(id);
    }

}